// 请求频道信息模块

import request from '@/utils/request'

// 获取所有频道
export const getAllChannel = () => {
  return request({
    method: 'get',
    url: '/app/v1_0/channels'
  })
}

// 修改用户频道列表
export const addChannel = channel => {
  return request({
    method: 'PATCH',
    url: '/app/v1_0/user/channels',
    data: {
      channels: [channel]
    }
  })
}

// 删除用户频道列表
export const deleteChannel = id => {
  return request({
    method: 'DELETE',
    url: `/app/v1_0/user/channels/${id}`
  })
}
